/*
package com.lpit.config;

import io.mycat.config.model.rule.RuleAlgorithm;
import io.mycat.route.function.AbstractPartitionAlgorithm;
import lombok.Data;

@Data
public class BloggerRule extends AbstractPartitionAlgorithm implements RuleAlgorithm {

    private Long valueNumber;
    private Integer step;
    private Integer mod;


    @Override
    public Integer calculate(String s) {
        if (s != null) {
            String[] split = s.split("-");
            if (split.length == 2) {
                Long dataId = Long.valueOf(split[0]);
                Long bursId = Long.valueOf(split[1]);

                int group = (int) (dataId / valueNumber) / step;
                Integer pos = group + (int) (bursId % mod);

                System.out.println(s + "+" + pos);
                return pos;
            }
        }
        return null;
    }

    @Override
    public Integer[] calculateRange(String beginValue, String endValue) {
        if (null != beginValue && null != endValue) {
            Integer begin = this.calculate(beginValue);
            Integer end = this.calculate(endValue);

            if (begin == null || end == null) {
                return new Integer[0];
            }

            if (end >= begin) {
                int len = end - begin + 1;

                Integer[] integers = new Integer[len];

                for (int i = 0; i < integers.length; i++) {
                    integers[i] = begin + i;
                }

                return integers;
            }
        }

        return new Integer[0];
    }
}
*/
